finding the rate of change